/*
 Navicat Premium Data Transfer

 Source Server         :
 Source Server Type    : MySQL
 Source Server Version : 50732
 Source Host           :
 Source Schema         : drpdb

 Target Server Type    : MySQL
 Target Server Version : 50732
 File Encoding         : 65001

 Date: 23/06/2022 22:49:17
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for async_calculate_log
-- ----------------------------
DROP TABLE IF EXISTS `async_calculate_log`;
CREATE TABLE `async_calculate_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `type` tinyint(4) DEFAULT NULL COMMENT '类型 1:BOM 2:生产速度 3:生产队列 4:零件信息 5:零件装配延误时间 6:库存 7:承运商 8:作业时间 9:厂内运行时间\n',
  `start_time` datetime DEFAULT NULL COMMENT '执行开始时间',
  `end_time` datetime DEFAULT NULL COMMENT '执行结束时间',
  `init_time` int(11) DEFAULT '0' COMMENT '初始化时长（秒）',
  `cal_time` int(11) DEFAULT '0' COMMENT '计算时长（秒）',
  `save_time` int(11) DEFAULT '0' COMMENT '保存时长（秒）',
  `status` tinyint(4) DEFAULT NULL COMMENT '执行状态：1：成功 2：失败',
  `reason` text COLLATE utf8mb4_bin COMMENT '失败原因',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  `version_id` int(11) DEFAULT NULL COMMENT '版本编号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
-- Records of async_calculate_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for async_download_log
-- ----------------------------
DROP TABLE IF EXISTS `async_download_log`;
CREATE TABLE `async_download_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `type` tinyint(4) DEFAULT NULL COMMENT '类型 1:BOM 2:生产速度 3:生产队列 4:零件信息 5:零件装配延误时间 6:库存 7:承运商 8:作业时间 9:厂内运行时间\n',
  `file` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '文件名(含完整路径)',
  `file_name` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '文件名(不含路径)',
  `start_time` datetime DEFAULT NULL COMMENT '执行开始时间',
  `end_time` datetime DEFAULT NULL COMMENT '执行结束时间',
  `status` tinyint(4) DEFAULT NULL COMMENT '执行状态：1：成功 2：失败',
  `reason` text COLLATE utf8mb4_bin COMMENT '失败原因',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  `version_id` int(11) DEFAULT NULL COMMENT '版本编号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
-- Records of async_download_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for async_upload_log
-- ----------------------------
DROP TABLE IF EXISTS `async_upload_log`;
CREATE TABLE `async_upload_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `type` tinyint(4) DEFAULT NULL COMMENT '类型 1:BOM 2:生产速度 3:生产队列 4:零件信息 5:零件装配延误时间 6:库存 7:承运商 8:作业时间 9:厂内运行时间\n',
  `file` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '文件名(含完整路径)',
  `file_name` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '文件名(不含路径)',
  `start_time` datetime DEFAULT NULL COMMENT '执行开始时间',
  `end_time` datetime DEFAULT NULL COMMENT '执行结束时间',
  `status` tinyint(4) DEFAULT NULL COMMENT '执行状态：1：成功 2：失败',
  `reason` text COLLATE utf8mb4_bin COMMENT '失败原因',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  `version_id` int(11) DEFAULT NULL COMMENT '版本编号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
-- Records of async_upload_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for bom
-- ----------------------------
DROP TABLE IF EXISTS `bom`;
CREATE TABLE `bom` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `production_line` int(11) DEFAULT NULL COMMENT '生产线 1：焊装 2：涂装 3：总装',
  `version_name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '版本名称',
  `factory_id` int(11) DEFAULT NULL COMMENT '工厂ID',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `ix_bom_version_id` (`version_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='BOM主表';

-- ----------------------------
-- Records of bom
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for bom_details
-- ----------------------------
DROP TABLE IF EXISTS `bom_details`;
CREATE TABLE `bom_details` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `bom_id` int(11) DEFAULT NULL COMMENT 'BOM主表ID',
  `car_model` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '车型代码',
  `part_code` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '零件号',
  `part_name` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '零件名称',
  `per_number` decimal(10,4) DEFAULT NULL COMMENT '单车零件用量',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `ix_bom_details_bom_id` (`bom_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='BOM详情表';

-- ----------------------------
-- Records of bom_details
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for factory
-- ----------------------------
DROP TABLE IF EXISTS `factory`;
CREATE TABLE `factory` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `name` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '工程名称',
  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  `update_date` datetime DEFAULT NULL COMMENT '更新时间',
  `is_del` int(11) DEFAULT NULL COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='工厂管理';

-- ----------------------------
-- Records of factory
-- ----------------------------
BEGIN;
INSERT INTO `factory` (`id`, `name`, `create_date`, `update_date`, `is_del`) VALUES (1, '一工厂', '2022-06-12 00:24:02', '2022-06-12 00:24:08', 0);
INSERT INTO `factory` (`id`, `name`, `create_date`, `update_date`, `is_del`) VALUES (2, '二工厂', '2022-06-12 00:24:02', '2022-06-12 00:24:08', 0);
INSERT INTO `factory` (`id`, `name`, `create_date`, `update_date`, `is_del`) VALUES (3, '三工厂', '2022-06-12 00:24:02', '2022-06-12 00:24:08', 0);
COMMIT;

-- ----------------------------
-- Table structure for factory_transport_time
-- ----------------------------
DROP TABLE IF EXISTS `factory_transport_time`;
CREATE TABLE `factory_transport_time` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `version_name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '版本名称',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='厂内运行时间';

-- ----------------------------
-- Records of factory_transport_time
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for factory_transport_time_details
-- ----------------------------
DROP TABLE IF EXISTS `factory_transport_time_details`;
CREATE TABLE `factory_transport_time_details` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `factory_transport_time_id` int(11) DEFAULT NULL COMMENT '厂内运行时间主表ID',
  `work_site` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '作业点',
  `transport_time` int(11) DEFAULT NULL COMMENT '从工厂到达地址到作业点时间（分钟）',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`),
  KEY `ix_factory_transport_time_details_factory_transport_time_id` (`factory_transport_time_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='厂内运行时间详情表';

-- ----------------------------
-- Records of factory_transport_time_details
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for inventory
-- ----------------------------
DROP TABLE IF EXISTS `inventory`;
CREATE TABLE `inventory` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `version_name` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '版本名称',
  `factory_id` int(11) DEFAULT NULL COMMENT '工厂ID',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='零件库存主表\n';

-- ----------------------------
-- Records of inventory
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for inventory_details
-- ----------------------------
DROP TABLE IF EXISTS `inventory_details`;
CREATE TABLE `inventory_details` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `inventory_id` int(11) DEFAULT NULL COMMENT '库存主表ID',
  `parts_code` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '零件件号',
  `parts_name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '零件名称',
  `parts_inventory` int(11) DEFAULT NULL COMMENT '零件库存数',
  `factory_name` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '工厂',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='零件库存详情表\n';

-- ----------------------------
-- Records of inventory_details
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for operation_time
-- ----------------------------
DROP TABLE IF EXISTS `operation_time`;
CREATE TABLE `operation_time` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `version_name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '版本名称',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='作业主表';

-- ----------------------------
-- Records of operation_time
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for operation_time_details
-- ----------------------------
DROP TABLE IF EXISTS `operation_time_details`;
CREATE TABLE `operation_time_details` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `operation_time_id` int(11) DEFAULT NULL COMMENT '作业时间主表ID',
  `work_site` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '作业点名称',
  `work_time` int(11) DEFAULT NULL COMMENT 'work_time',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='作业时间明细表';

-- ----------------------------
-- Records of operation_time_details
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for order_plan
-- ----------------------------
DROP TABLE IF EXISTS `order_plan`;
CREATE TABLE `order_plan` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `version_name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '版本名称',
  `status` int(11) DEFAULT NULL COMMENT '运算状态：1：待运算 2：运算中 3：运算成功 4：运算失败',
  `shipper_version_id` int(11) DEFAULT NULL COMMENT '承运商版本编号',
  `supplier_address_version_id` int(11) DEFAULT NULL COMMENT '供货商地址版本编号',
  `supplier_distance_version_id` int(11) DEFAULT NULL COMMENT '供货商距离版本编号',
  `supplier_duration_version_id` int(11) DEFAULT NULL COMMENT '供货商路程时间版本编号',
  `operation_time_version_id` int(11) DEFAULT NULL COMMENT '作业时间版本编号',
  `factory_transport_time_version_id` int(11) DEFAULT NULL COMMENT '厂内运转时间版本编号',
  `algorithm_id` int(11) DEFAULT NULL COMMENT '算法ID',
  `loading_percentage` decimal(11,5) DEFAULT NULL COMMENT '平均装载率',
  `trip_number` int(11) DEFAULT NULL COMMENT '总趟数',
  `cost` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '总路程成本',
  `van_enough` tinyint(4) DEFAULT NULL COMMENT '车辆是否充足 0:不充足 1:充足',
  `version_desc` text COLLATE utf8mb4_bin COMMENT '版本描述',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `ix_require_version_id` (`version_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='排单主表';

-- ----------------------------
-- Records of order_plan
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for order_plan_details
-- ----------------------------
DROP TABLE IF EXISTS `order_plan_details`;
CREATE TABLE `order_plan_details` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `order_plan_id` int(11) DEFAULT NULL COMMENT '排单计划编号',
  `van_code` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '货车编号',
  `van_size` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '物流车型',
  `supplier_name` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '供应商名称',
  `supplier_address` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '供应商地址',
  `parts_code` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '零件编号',
  `parts_name` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '零件名称',
  `parts_quantity` int(11) DEFAULT NULL COMMENT '零件数量',
  `parts_box_quantity` int(11) DEFAULT NULL COMMENT '箱数',
  `parts_snp` int(11) DEFAULT NULL COMMENT '单包装容量',
  `parts_packaging_type` varchar(16) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '包装类型',
  `factory` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '目的地工厂',
  `unloading_crossing` varchar(16) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '交付道口',
  `distance` decimal(10,2) DEFAULT NULL COMMENT '路程距离',
  `loading_percentage` decimal(11,5) DEFAULT NULL COMMENT '装载率',
  `cost` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '路程成本',
  `trip_number` int(11) DEFAULT NULL COMMENT '趟数',
  `arrival_time` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '预计抵达时间 格式2022-05-13 08:00:00',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `ix_order_plan_details_order_plan_id` (`order_plan_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='排单详情表';

-- ----------------------------
-- Records of order_plan_details
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for order_plan_inventory
-- ----------------------------
DROP TABLE IF EXISTS `order_plan_inventory`;
CREATE TABLE `order_plan_inventory` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `order_plan_id` int(11) DEFAULT NULL COMMENT '排单计划编号',
  `inventory_version_id` int(11) DEFAULT NULL COMMENT '库存版本编号',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='排单计划-库存版本';

-- ----------------------------
-- Records of order_plan_inventory
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for order_plan_parts
-- ----------------------------
DROP TABLE IF EXISTS `order_plan_parts`;
CREATE TABLE `order_plan_parts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `order_plan_id` int(11) DEFAULT NULL COMMENT '排单计划编号',
  `parts_version_id` int(11) DEFAULT NULL COMMENT '零件版本编号',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='排单计划-零件版本';

-- ----------------------------
-- Records of order_plan_parts
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for parts
-- ----------------------------
DROP TABLE IF EXISTS `parts`;
CREATE TABLE `parts` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `production_line` int(11) DEFAULT NULL COMMENT '生产线 1：焊装 2：涂装 3：总装',
  `version_name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '版本名称',
  `factory_id` int(11) DEFAULT NULL COMMENT '工厂ID',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `ix_parts_version_id` (`version_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='零件主表';

-- ----------------------------
-- Records of parts
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for parts_details
-- ----------------------------
DROP TABLE IF EXISTS `parts_details`;
CREATE TABLE `parts_details` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `parts_id` int(11) DEFAULT NULL COMMENT '零件主表ID',
  `code` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '零件件号',
  `name` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '零件名称',
  `lr_parts` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '左右件',
  `loading_direction` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '装车朝向',
  `factory` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '工厂',
  `unloading_crossing` varchar(16) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '卸货道口',
  `safety_stock` int(11) DEFAULT NULL COMMENT '存储区安全库存',
  `max_stock` int(11) DEFAULT NULL COMMENT '存储区最大库存',
  `supplier_name` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '供应商名称',
  `packaging_type` varchar(16) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '包装类型',
  `material_rack_pallet_adapted` varchar(1) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '料架是否能和托盘堆',
  `length` int(11) DEFAULT NULL COMMENT '长',
  `width` int(11) DEFAULT NULL COMMENT '宽',
  `height` int(11) DEFAULT NULL COMMENT '高',
  `snp` int(11) DEFAULT NULL COMMENT 'SNP',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `ix_parts_details_parts_id` (`parts_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='零件详情表';

-- ----------------------------
-- Records of parts_details
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for parts_load_delay_time
-- ----------------------------
DROP TABLE IF EXISTS `parts_load_delay_time`;
CREATE TABLE `parts_load_delay_time` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `production_line` int(11) DEFAULT NULL COMMENT '生产线 1：焊装 2：涂装 3：总装',
  `version_name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '版本名称',
  `factory_id` int(11) DEFAULT NULL COMMENT '工厂ID',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `ix_parts_load_delay_time_version_id` (`version_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='零件装载延误时间主表';

-- ----------------------------
-- Records of parts_load_delay_time
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for parts_load_delay_time_details
-- ----------------------------
DROP TABLE IF EXISTS `parts_load_delay_time_details`;
CREATE TABLE `parts_load_delay_time_details` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `parts_load_delay_time_id` int(11) DEFAULT NULL COMMENT '零件装载延误时间主表ID',
  `parts_code` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '零件',
  `parts_name` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '零件名称',
  `time` decimal(10,2) DEFAULT NULL COMMENT '对应装配(分钟)',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `ix_parts_load_delay_time_details_parts_load_delay_time_id` (`parts_load_delay_time_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='零件装载延误时间详情表';

-- ----------------------------
-- Records of parts_load_delay_time_details
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for produce_queue
-- ----------------------------
DROP TABLE IF EXISTS `produce_queue`;
CREATE TABLE `produce_queue` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `production_line` int(11) DEFAULT NULL COMMENT '生产线 1：焊装 2：涂装 3：总装',
  `version_name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '版本名称',
  `factory_id` int(11) DEFAULT NULL COMMENT '工厂ID',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `ix_produce_queue_version_id` (`version_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='生产队列主表';

-- ----------------------------
-- Records of produce_queue
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for produce_queue_details
-- ----------------------------
DROP TABLE IF EXISTS `produce_queue_details`;
CREATE TABLE `produce_queue_details` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `produce_queue_id` int(11) DEFAULT NULL COMMENT '生产队列主表ID',
  `car_model` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '车型',
  `optional_equipment` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '选装件',
  `colour_code` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '颜色代码',
  `colour_name` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '颜色名',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `ix_produce_queue_details_produce_queue_id` (`produce_queue_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='生产队列详情表';

-- ----------------------------
-- Records of produce_queue_details
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for produce_speed
-- ----------------------------
DROP TABLE IF EXISTS `produce_speed`;
CREATE TABLE `produce_speed` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `production_line` tinyint(4) DEFAULT NULL COMMENT '生产线 1：焊装 2：涂装 3：总装',
  `version_name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '版本ID',
  `factory_id` int(11) DEFAULT NULL COMMENT '工厂ID',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `ix_produce_speed_version_id` (`version_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='生产速度主表';

-- ----------------------------
-- Records of produce_speed
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for produce_speed_details
-- ----------------------------
DROP TABLE IF EXISTS `produce_speed_details`;
CREATE TABLE `produce_speed_details` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `produce_speed_id` int(11) DEFAULT NULL COMMENT '生产速度主表ID',
  `car_model` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '车型',
  `produce_speed` int(11) DEFAULT NULL COMMENT '生产速度',
  `meter` int(11) DEFAULT NULL COMMENT '节拍',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `ix_produce_speed_details_produce_speed_id` (`produce_speed_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='生产速度详情表';

-- ----------------------------
-- Records of produce_speed_details
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for require
-- ----------------------------
DROP TABLE IF EXISTS `require`;
CREATE TABLE `require` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `production_line` tinyint(1) DEFAULT NULL COMMENT '生产线 1：焊装 2：涂装 3：总装',
  `version_name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '版本名称',
  `factory_id` int(11) DEFAULT NULL COMMENT '工厂ID',
  `status` int(11) DEFAULT NULL COMMENT '状态：1：待运算 2：运算中 3：运算成功 4：运算失败',
  `reason` text COLLATE utf8mb4_bin COMMENT '失败原因',
  `bom_version_id` int(11) DEFAULT NULL COMMENT '参与运算的bom编号',
  `produce_queue_version_id` int(11) DEFAULT NULL COMMENT '参与运算的生产队列编号',
  `produce_speed_version_id` int(11) DEFAULT NULL COMMENT '参与运算的生产速度编号',
  `parts_version_id` int(11) DEFAULT NULL COMMENT '参与运算的零件编号',
  `load_delay_time_version_id` int(11) DEFAULT NULL COMMENT '参与运算的零件装配延误时间的版本编号',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `ix_require_version_id` (`version_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='零件需求主表';

-- ----------------------------
-- Records of require
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for require_details
-- ----------------------------
DROP TABLE IF EXISTS `require_details`;
CREATE TABLE `require_details` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `require_id` int(11) DEFAULT NULL COMMENT '零件需求主表ID',
  `parts_code` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '零件件号',
  `parts_name` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '零件名称',
  `arrival_time` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '到货时间 格式2022-05-13 08:00:00',
  `quantity` int(11) DEFAULT NULL COMMENT '数量',
  `supplier_name` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '供应商名称',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `ix_require_details_require_id` (`require_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='零件需求明细表';

-- ----------------------------
-- Records of require_details
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for require_summary
-- ----------------------------
DROP TABLE IF EXISTS `require_summary`;
CREATE TABLE `require_summary` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `version_name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '版本名称',
  `factory_id` int(11) DEFAULT NULL COMMENT '工厂ID',
  `status` int(11) DEFAULT NULL COMMENT '焊装状态：1：待运算 2：已运算',
  `weld_version_id` int(11) DEFAULT NULL COMMENT '参与运算的焊装版本编号',
  `paint_version_id` int(11) DEFAULT NULL COMMENT '参与运算的涂装版本编号',
  `summary_version_id` int(11) DEFAULT NULL COMMENT '参与运算的总装版本编号',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `ix_require_version_id` (`version_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='零件需求汇总表';

-- ----------------------------
-- Records of require_summary
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for schedule
-- ----------------------------
DROP TABLE IF EXISTS `schedule`;
CREATE TABLE `schedule` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `item` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '时间项',
  `begin_time` varchar(10) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '开始时间',
  `end_time` varchar(10) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '结束时间',
  `order_type` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '排班类型 1.短白班 2.长白班 3.白夜班',
  `work_type` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '作息类型 1.上班时间 2.休息时间',
  `factory_id` int(11) DEFAULT NULL COMMENT '工厂编号',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='排班表';

-- ----------------------------
-- Records of schedule
-- ----------------------------
BEGIN;
INSERT INTO `schedule` (`id`, `item`, `begin_time`, `end_time`, `order_type`, `work_type`, `factory_id`, `create_date`, `update_date`, `is_del`) VALUES (7, 'test4', '08:00:00', '12:00:00', '短白班', '上班时间', 2, '2022-06-07 23:39:06', '2022-06-07 23:39:06', 0);
INSERT INTO `schedule` (`id`, `item`, `begin_time`, `end_time`, `order_type`, `work_type`, `factory_id`, `create_date`, `update_date`, `is_del`) VALUES (8, 'test5', '14:00:00', '18:00:00', '短白班', '上班时间', 2, '2022-06-07 23:39:06', '2022-06-07 23:39:06', 0);
INSERT INTO `schedule` (`id`, `item`, `begin_time`, `end_time`, `order_type`, `work_type`, `factory_id`, `create_date`, `update_date`, `is_del`) VALUES (9, 'test6', '19:42:56', '19:42:56', '短白班', '上班时间', 1, '2022-06-07 23:39:06', '2022-06-07 23:39:06', 0);
INSERT INTO `schedule` (`id`, `item`, `begin_time`, `end_time`, `order_type`, `work_type`, `factory_id`, `create_date`, `update_date`, `is_del`) VALUES (10, 'test6', '08:00:00', '18:00:00', '长白班', '休息时间', 1, '2022-06-07 23:39:06', '2022-06-07 23:39:06', 0);
INSERT INTO `schedule` (`id`, `item`, `begin_time`, `end_time`, `order_type`, `work_type`, `factory_id`, `create_date`, `update_date`, `is_del`) VALUES (11, 'test7', '08:00:00', '18:00:00', '长白班', '休息时间', 1, '2022-06-07 23:39:06', '2022-06-07 23:39:06', 0);
COMMIT;

-- ----------------------------
-- Table structure for shipper
-- ----------------------------
DROP TABLE IF EXISTS `shipper`;
CREATE TABLE `shipper` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `version_name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '版本名称',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='承运商主表';

-- ----------------------------
-- Records of shipper
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for shipper_details
-- ----------------------------
DROP TABLE IF EXISTS `shipper_details`;
CREATE TABLE `shipper_details` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `shipper_id` int(11) DEFAULT NULL COMMENT '主表编号',
  `shipper_name` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT '名称',
  `van_code` varchar(32) COLLATE utf8mb4_bin NOT NULL COMMENT '车牌',
  `carriage_length` decimal(10,2) NOT NULL COMMENT '车厢长',
  `carriage_width` decimal(10,2) NOT NULL COMMENT '车厢宽',
  `carriage_height` decimal(10,2) NOT NULL COMMENT '车厢高',
  `daily_fixed_cost` decimal(10,2) NOT NULL COMMENT '车辆每日固定成本',
  `operating_costs` decimal(10,2) NOT NULL COMMENT '车辆运营成本（元/公里）',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='承运商明细表';

-- ----------------------------
-- Records of shipper_details
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for supplier_address
-- ----------------------------
DROP TABLE IF EXISTS `supplier_address`;
CREATE TABLE `supplier_address` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `version_name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '版本名称',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='供货商地址表';

-- ----------------------------
-- Records of supplier_address
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for supplier_address_details
-- ----------------------------
DROP TABLE IF EXISTS `supplier_address_details`;
CREATE TABLE `supplier_address_details` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `supplier_id` int(11) DEFAULT NULL COMMENT '主表编号',
  `supplier_name` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT '供货商1名称',
  `supplier_address` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '供货商2名称',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='供货商地址明细表';

-- ----------------------------
-- Records of supplier_address_details
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for supplier_distance
-- ----------------------------
DROP TABLE IF EXISTS `supplier_distance`;
CREATE TABLE `supplier_distance` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `version_name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '版本名称',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='供货商距离表';

-- ----------------------------
-- Records of supplier_distance
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for supplier_distance_details
-- ----------------------------
DROP TABLE IF EXISTS `supplier_distance_details`;
CREATE TABLE `supplier_distance_details` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `supplier_distance_id` int(11) DEFAULT NULL COMMENT '主表编号',
  `supplier_first_name` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT '供货商1名称',
  `supplier_second_name` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT '供货商2名称',
  `distance` int(11) DEFAULT NULL COMMENT '距离(米)',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='供货商距离明细表';

-- ----------------------------
-- Records of supplier_distance_details
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for supplier_duration
-- ----------------------------
DROP TABLE IF EXISTS `supplier_duration`;
CREATE TABLE `supplier_duration` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `version_name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '版本名称',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='供货商路程时间表';

-- ----------------------------
-- Records of supplier_duration
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for supplier_duration_details
-- ----------------------------
DROP TABLE IF EXISTS `supplier_duration_details`;
CREATE TABLE `supplier_duration_details` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `supplier_duration_id` int(11) DEFAULT NULL COMMENT '主表编号',
  `supplier_first_name` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT '供货商1名称',
  `supplier_second_name` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT '供货商2名称',
  `duration` int(11) DEFAULT NULL COMMENT '时间(秒)',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='供货商路程时间明细表';

-- ----------------------------
-- Records of supplier_duration_details
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for version
-- ----------------------------
DROP TABLE IF EXISTS `version`;
CREATE TABLE `version` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `name` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '版本名称',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_del` int(11) DEFAULT '0' COMMENT '状态，1删除；0未删除',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='版本管理';

-- ----------------------------
-- Records of version
-- ----------------------------
BEGIN;
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
